<?PHP
include("settings.php");
$c = intval($_GET['c']);
if (file_exists($settings['workingdir'] . '/images/avatars/' . $c . '.jpg') and filesize($settings['workingdir'] . '/images/avatars/' . $c . '.jpg' ) <= 100)
{
       unlink ($settings['workingdir'] . '/images/avatars/' . $c . '.jpg' );
}
if (!file_exists($settings['workingdir'] . '/images/avatars/' . $c . '.jpg'))
{
        $buffer = file_get_contents('http://img.eve.is/serv.asp?c=' . $c . '&s=64');
        file_put_contents ($settings['workingdir'] . '/images/avatars/' . $c . '.jpg', $buffer );
}
header('Content-Type: image/jpeg');
readfile($settings['workingdir'] . '/images/avatars/' . $c . '.jpg' );
?>